﻿//
// Created: 2018/11/7
// Author: chenqiang
//
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration;
using Model.WeiXin;

namespace Model.WeiXin.Map
{
    internal  class WeiXinMessageMap:EntityTypeConfiguration< WeiXinMessage >    
    {
        public WeiXinMessageMap()
        {
             this.ToTable("WeiXin_Message");
             this.HasKey(i => new { i.MessageID });
             this.Property(i => i.MessageID).HasColumnName("MessageID");                     
             this.Property(i => i.MsgType).HasColumnName("MsgType");                     
             this.Property(i => i.TemplateID).HasColumnName("TemplateID");                     
             this.Property(i => i.Sender).HasColumnName("Sender");                     
             this.Property(i => i.SenderUserID).HasColumnName("SenderUserID");                     
             this.Property(i => i.UserID).HasColumnName("UserID");                     
             this.Property(i => i.Subject).HasColumnName("Subject");                     
             this.Property(i => i.OpenId).HasColumnName("OpenId");                     
             this.Property(i => i.Content).HasColumnName("Content");                     
             this.Property(i => i.MessageBody).HasColumnName("MessageBody");                     
             this.Property(i => i.CreateTime).HasColumnName("CreateTime");                     
             this.Property(i => i.SendTime).HasColumnName("SendTime");                     
             this.Property(i => i.State).HasColumnName("State");                     
             this.Property(i => i.Remark).HasColumnName("Remark");                     
             this.Property(i => i.SendCount).HasColumnName("SendCount");                     
             this.Property(i => i.WXMsgId).HasColumnName("WXMsgId");                     
             this.Property(i => i.ConfirmTime).HasColumnName("ConfirmTime");                     
             this.Property(i => i.WXResult).HasColumnName("WXResult");                     
             this.Property(i => i.AppID).HasColumnName("AppID");                     
        }   
    }
    
     public static class WeiXinMessageMapExtensions
    {
        public static void UserWeiXinMessageMap(this DbModelBuilder pModelBuilder)
        {
            pModelBuilder.Configurations.Add(new WeiXinMessageMap());
        }
    }
}